﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

[ServiceContract]
public interface IChangeItemCtrl
{
    [OperationContract]
    List<Item> GetAllItem();

    [OperationContract]
    void UpdateItem(Guid itemID, String itemTitle, String itemDescription, String itemImage, String itemTag, Boolean bidStat, DateTime bidStartDate, DateTime bidEndDate, int bidIncremement, float minimumBid, Guid categoryID);
}
[DataContract]
public class Item
{
    Guid itemId;
    [DataMember]
    public Guid ItemId
    {
        get { return itemId; }
        set { itemId = value; }
    }

    String itemTitle;
    [DataMember]
    public String ItemTitle
    {
        get { return itemTitle; }
        set { itemTitle = value; }
    }
    String itemDescription;
    [DataMember]
    public String ItemDescription
    {
        get { return itemDescription; }
        set { itemDescription = value; }
    }
    String itemImage;
    [DataMember]
    public String ItemImage
    {
        get { return itemImage; }
        set { itemImage = value; }
    }
    String itemTag;
    [DataMember]
    public String ItemTag
    {
        get { return itemTag; }
        set { itemTag = value; }
    }
    Boolean bidStat;
    [DataMember]
    public Boolean BidStat
    {
        get { return bidStat; }
        set { bidStat = value; }
    }
    DateTime bidStartDate;
    [DataMember]
    public DateTime BidStartDate
    {
        get { return bidStartDate; }
        set { bidStartDate = value; }
    }
    DateTime bidEndDate;
    [DataMember]
    public DateTime BidEndDate
    {
        get { return bidEndDate; }
        set { bidEndDate = value; }
    }
    int bidIncremement;
    [DataMember]
    public int BidIncremement
    {
        get { return bidIncremement; }
        set { bidIncremement = value; }
    }
    float minimumBid;
    [DataMember]
    public float MinimumBid
    {
        get { return minimumBid; }
        set { minimumBid = value; }
    }
    Guid categoryID;
    [DataMember]
    public Guid CategoryID
    {
        get { return categoryID; }
        set { categoryID = value; }
    }

    public Item(Item_Table itemcopy)
    {
        itemId = itemcopy.Item_ID;
        itemTitle = itemcopy.Item_Title;
        itemDescription = itemcopy.Item_Description;
        itemImage = itemcopy.Item_Image;
        itemTag = itemcopy.Item_Tag;
        bidStat = itemcopy.Bid_Status;
        bidStartDate = itemcopy.Bid_StartDate;
        bidEndDate = itemcopy.Bid_EndDat;
        bidIncremement = (int)itemcopy.Bid_Incremenent;
        minimumBid = (float)itemcopy.Minimum_Bid;
        categoryID = itemcopy.Category_ID;
    }
}
